import request from '@/config/axios'

// 查询语音列表
export const getIvrVoicePage = async (params) => {
  return await request.get({ url: `/call/ivr-voice/page`, params })
}
// 查询语音全部
export const getIvrVoiceAll = async (params) => {
  return await request.get({ url: `/call/ivr-voice/list`, params })
}
// 创建语音文件
export const createIvrVoice = async (data) => {
  return await request.post({ url: `/call/ivr-voice/create`, data })
}
// 更改语音文件
export const updateIvrVoice = async (data) => {
  return await request.put({ url: `/call/ivr-voice/update`, data })
}
// 删除语音文件
export const deleteIvrVoice = async (id) => {
  return await request.delete({ url: `/call/ivr-voice/delete?id=` + id })
}
// 语音文件详情
export const getVoice = async (id) => {
  return await request.get({ url: `/call/ivr-voice/get?id=` + id })
}
// 音色列表
export const getTimbre = async () => {
  return await request.get({ url: `/call/ivr-timbre/list` })
}
// 获取当前ivr合成音
export const getByFlowId = async (params) => {
  return await request.get({ url: `/call/ivr-robot-timbre/getByFlowId`, params })
}

// 根据话术手动上传接口
export const createVoiceByNodeIdManual = async (formData) => {
  return await request.upload({ url: `/call/ivr-voice/createVoiceByNodeIdManual`, data: formData })
}
// 根据知识库手动上传接口
export const knowledgeIssueVoiceByIdCreateManual = async (formData) => {
  return await request.upload({
    url: `/call/ivr-knowledge-issue/knowledgeIssueVoiceByIdCreateManual`,
    data: formData
  })
}
// 命中统计
export const ivrFlowBranchStat = async (id) => {
  return await request.get({
    url: `/call/ivr-flow-branch-stat/simple-list?flowId=${id}`
  })
}
